import java.util.Comparator;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:岁亮亮
 * Date:2024-01-14
 * TIME:13:06
 */

class person implements Comparable <person>{
    @Override
    public int compareTo(person o) {
      return this.age-o.age;
    }

    String name;
    int age;
    static int a=12;
    static person person=new person("sui",14);
    static person person1=new person("dui",14);
    static person person2=new person("hui",14);
    public person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    static {
        System.out.println("hehe");
        System.out.println("hehe");
        person.a++;
        person1.a++;
        person2.a++;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    {
        System.out.println("呵呵");
        System.out.println("呵呵");
    }

    @Override
    public String toString() {
        return "person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}



public class Test {

    public static void main(String[] args) {
        person person1=new person("sui",12);
        person person2=new person("hui",14);
        System.out.println(person1.compareTo(person2));
    }
    public static void main3(String[] args) {
      /* Student student1=new student1();
      student1.goschool() ;*/

    }
    public static void main2(String[] args) {
        //Student student=new Student("sui",12);
        //System.out.println(student);
    }
    public static void main1(String[] args) {
       /* person person=new person("sui",12);
        System.out.println(person);
        System.out.println(person.a);//打印15;*/
       /* person person1=new person("hui",13);
        System.out.println(person1);*/
    }

}
class Namesyu implements Comparator  <person>{
    @Override
    public int compare(person o1, person o2) {
        return o1.name .compareTo(o2.name);
    }

    @Override
    public Comparator<person> reversed() {
        return Comparator.super.reversed();
    }
}
class Age implements Comparator<person>{
    @Override
    public int compare(person o1, person o2) {
        return 0;
    }

    @Override
    public Comparator<person> reversed() {
        return Comparator.super.reversed();
    }
}

















